package com.itheima.lambda;

public class LambdaDemo {
    public static void main(String[] args) {
        //不能用lambda表达式，因为Animal是抽象类，不是函数式接口
        Animal animal = new Animal() {
            @Override
            public void eat() {
                System.out.println("eat");
            }
        };
        animal.eat();

        Swim s1 = () -> {
            System.out.println("狗刨");
        };
        s1.swimming();
    }
}

abstract class Animal{
    public abstract void eat();
}

//函数式接口
@FunctionalInterface
interface Swim{
    void swimming();
}